#include "widget.h"
#include "ui_widget.h"
#include "ctrl.h"
#include <QString>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    system("echo none > /sys/class/leds/sys-led/trigger");
    system("echo 0 > /sys/class/leds/sys-led/brightness");
    ui->setupUi(this);
    connect(ui->logobt,SIGNAL(clicked()),this,SLOT(logobt_clicked_slots()));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_registerbt_clicked()
{
    qDebug("registerbt_clicked");
}

void Widget::logobt_clicked_slots()
{
    QString userName=ui->userEdit->text();
    QString passwd=ui->passwdEdit->text();
    if(userName=="123456"&&passwd=="wyj")
    {
        ctrl *ct=new ctrl;
        ct->setGeometry(this->geometry());
        ct->show();
    }
}
